<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/view/common/includes.jsp" %>
<%@ include file="/WEB-INF/view/inc.jsp" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="Generator" content="EditPlus®">
    <meta name="Author" content="">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <title>Document</title>
    <style type="text/css">
        .body_div {
            MARGIN-RIGHT: auto;
            MARGIN-LEFT: auto;
            margin-top: 50px;
            width:800px;
            vertical-align:middle;
            line-height:30px;
        }
        .font_title{
            font-weight: bold;
            font-family: oblique;
            color: #245269 ;
        }
        table td{
            width: 300px;
            height: 50px;
            cellpadding:20px;
            cellspacing:10px;
        }
        .goods_info {
            border: solid 1px #000000;
            border-collapse:collapse;
            background-color: #EEEEEE;
        }

        .goods_info td{
            height: 10px;
            border:1px solid #999999;padding:5px 15px;font-size: 15px;
            text-align: center;
            cellpadding:2px;
            cellspacing:2px;
        }

    </style>
</head>
<body>
    <div class="body_div">
        <span class="font_title">订单详情：</span>
        <div>
            <table>
                <tr>
                    <td>订单编号:</td>
                    <td>${orderInfoVo.order.id}</td>
                    <td>订单金额:</td>
                    <td>${orderInfoVo.order.totalAmount}</td>
                    <td>订单日期:</td>
                    <td>${orderInfoVo.order.createTime}</td>
                </tr>
                <tr>
                    <td>买家留言:</td>
                    <td>${orderInfoVo.order.buyerMsg}</td>
                    <td>备注:</td>
                    <td>${orderInfoVo.order.remarks}</td>
                    <td></td>
                    <td></td>
                </tr>
            </table>
        </div>
        <div>
            <span class="font_title">商品详情：</span>
            <table class="goods_info">
                <tr>
                    <td>商品图片</td>
                    <td>商品单价</td>
                    <td>商品数量</td>
                    <td>商品总价</td>
                </tr>
                <c:forEach items="${orderInfoVo.orderItemInfos}" var="orderItemInfo">
                <tr>
                    <td><img src="/file/${orderItemInfo.goodsSmImg}"></td>
                    <td>${orderItemInfo.currPrice}</td>
                    <td>${orderItemInfo.quantities}</td>
                    <td>${orderItemInfo.total}</td>
                </tr>
                </c:forEach>
            </table>
        </div>
        <div>
            <span class="font_title">物流信息：</span>
            <table>
                <tr>
                    <td>收货人:</td>
                    <td>${orderInfoVo.order.shippingName}</td>
                    <td>收货电话:</td>
                    <td>${orderInfoVo.order.shippingTel}</td>
                </tr>
                <tr>
                    <td>收货地址:</td>
                    <td>${orderInfoVo.order.shippingAddress}</td>
                    <td>物流类型:</td>
                    <td id="streamType"></td>
                </tr>
            </table>
        </div>
    </div>
<script type="text/javascript">
        function doPrint() {
            window.print();
        }
        $(function(){
            var url = "/sys/codeItems/byCategoryCodeAndCode";
            var streamType = "streamType";
            var name;
            var  value = ${orderInfoVo.order.streamType};
                    $.ajax({
                        type: "post",
                        url: url,
                        data: {
                            categoryCode: streamType,
                            code: value
                        },
                        dataType: "json",
                        async: false,//同步请求
                        success: function (data) {
                            if(data.success) {
                                name =  data.obj;
                            }
                        }
                    });
            $("#streamType").text(name);
        })

</script>
</body>
</html>
